import { transformMapRecordToOption, transformRecordToOption } from '@/utils/common';

export const enableStatusRecord: Map<Api.Common.EnableStatus, Api.Common.EnableStatusLabel> = new Map([
  [true, '启用'],
  [false, '停用']
]);

export const enableStatusOptions = transformMapRecordToOption(enableStatusRecord);

export const menuTypeRecord: Record<ManageApi.MenuManage.MenuType, ManageApi.MenuManage.MenuTypeLabel> = {
  '0': '目录',
  '1': '菜单'
};

export const menuTypeOptions = transformRecordToOption(menuTypeRecord);

export const menuIconTypeRecord: Record<ManageApi.MenuManage.IconType, ManageApi.MenuManage.IconTypeLabel> = {
  '1': 'iconify图标',
  '2': '本地图标'
};
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);

export const ticketOpFlagRecord: Map<
  TicketManageApi.TicketManage.TicketOpFlag,
  TicketManageApi.TicketManage.TicketOpFlagLabel
> = new Map([
  [1, '开通'],
  [2, '退单']
]);

export const ticketOpFlagOptions = transformMapRecordToOption(ticketOpFlagRecord);

export const ticketProductTypeRecord: Map<
  TicketManageApi.TicketManage.TicketProductType,
  TicketManageApi.TicketManage.TicketProductTypeLable
> = new Map([
  [1, '免费版'],
  [2, '基础版'],
  [3, '旗舰版']
]);

export const ticketProductTypeOptions = transformMapRecordToOption(ticketProductTypeRecord);

export const ticketStatusRecord: Map<
  TicketManageApi.TicketManage.TicketStatus,
  TicketManageApi.TicketManage.TicketStatusLable
> = new Map([
  [1, '新建'],
  [2, '处理中'],
  [3, '已完成']
]);

export const ticketStatusOptions = transformMapRecordToOption(ticketStatusRecord);

export const deviceTypeRecord: Record<
  TicketManageApi.DeviceManage.DeviceType,
  TicketManageApi.DeviceManage.DeviceTypeLabel
> = {
  '31': 'PONAP',
  '32': 'GPON',
  '34': 'EPON',
  '38': 'FTTR'
};
export const deviceTypeOptions = transformRecordToOption(deviceTypeRecord);

/** 量子配置管理 */
export const ipsecEnableRecord: Map<Api.Common.EnableStatus, TicketManageApi.VPNManage.IpsecEnableLabel> = new Map([
  [true, '启用'],
  [false, '停用']
]);
export const ipsecEnableOptions = transformMapRecordToOption(ipsecEnableRecord);

/** 量子隧道连接状态 */
export const ipsecStatusRecord: Map<Api.Common.EnableStatus, TicketManageApi.VPNManage.IpsecStatusLabel> = new Map([
  [true, '已建立连接'],
  [false, '未建立连接']
]);
export const ipsecStatusOptions = transformMapRecordToOption(ipsecStatusRecord);

/** 量子配置模板 */
export const ipsecTypeRecord: Map<
  TicketManageApi.VPNTemplateManage.IpsecType,
  TicketManageApi.VPNTemplateManage.IpsecTypeLabel
> = new Map([
  [1, 'Site-to-Site'],
  [2, 'PC-to-Site']
]);
export const ipsecTypeOptions = transformMapRecordToOption(ipsecTypeRecord);

/** 封包模式 */
export const encapsulationModeRecord: Map<
  TicketManageApi.VPNTemplateManage.EncapsulationMode,
  TicketManageApi.VPNTemplateManage.EncapsulationModeLabel
> = new Map([
  [1, '隧道模式'],
  [2, '传输模式']
]);
export const encapsulationModeOptions = transformMapRecordToOption(encapsulationModeRecord);

/** IKE 验证方法 */
export const ikeVerifyMethodRecord: Map<
  TicketManageApi.VPNTemplateManage.IkeVerifyMethod,
  TicketManageApi.VPNTemplateManage.IkeVerifyMethodLabel
> = new Map([
  [1, 'PreShareKey'],
  [2, 'SM2+PQC']
]);
export const ikeVerifyMethodOptions = transformMapRecordToOption(ikeVerifyMethodRecord);

/** IKE 验证算法 */
export const ikeVerifyAlgorithmRecord: Map<
  TicketManageApi.VPNTemplateManage.IkeVerifyAlgorithm,
  TicketManageApi.VPNTemplateManage.IkeVerifyAlgorithmLabel
> = new Map([
  [1, 'MD5'],
  [2, 'SHA1'],
  [3, 'SHA256'],
  [4, 'SM3']
]);
export const ikeVerifyAlgorithmOptions = transformMapRecordToOption(ikeVerifyAlgorithmRecord);

/** IKE 加密算法 */
export const ikeEncryptAlgorithmRecord: Map<
  TicketManageApi.VPNTemplateManage.IkeEncryptAlgorithm,
  TicketManageApi.VPNTemplateManage.IkeEncryptAlgorithmLabel
> = new Map([
  [1, 'DES'],
  [2, '3DES'],
  [3, 'AES128'],
  [4, 'AES192'],
  [5, 'AES256'],
  [6, 'SM4']
]);
export const ikeEncryptAlgorithmOptions = transformMapRecordToOption(ikeEncryptAlgorithmRecord);

/** IKE 组参数 */
export const ikedhGroupRecord: Map<
  TicketManageApi.VPNTemplateManage.IkedhGroup,
  TicketManageApi.VPNTemplateManage.IkedhGroupLabel
> = new Map([
  [0, 'none'],
  [1, 'group1'],
  [2, 'group2'],
  [5, 'group5'],
  [14, 'group14']
]);
export const ikedhGroupOptions = transformMapRecordToOption(ikedhGroupRecord);

/** IPSec 认证算法 */
export const ipsecAuthAlgorithmRecord: Map<
  TicketManageApi.VPNTemplateManage.IpsecAuthAlgorithm,
  TicketManageApi.VPNTemplateManage.IpsecAuthAlgorithmLabel
> = new Map([
  [1, 'MD5'],
  [2, 'SHA1'],
  [3, 'SHA256'],
  [4, 'SM3']
]);
export const ipsecAuthAlgorithmOptions = transformMapRecordToOption(ipsecAuthAlgorithmRecord);

/** IPSec 加密算法 */
export const ipsecEncryptAlgorithmRecord: Map<
  TicketManageApi.VPNTemplateManage.IpsecEncryptAlgorithm,
  TicketManageApi.VPNTemplateManage.IpsecEncryptAlgorithmLabel
> = new Map([
  [1, '3DES'],
  [2, 'AES128'],
  [3, 'AES192'],
  [4, 'AES256'],
  [5, 'SM4']
]);
export const ipsecEncryptAlgorithmOptions = transformMapRecordToOption(ipsecEncryptAlgorithmRecord);

/** IPSec DH 组 */
export const ipsecPfsRecord: Map<
  TicketManageApi.VPNTemplateManage.IpsecPfs,
  TicketManageApi.VPNTemplateManage.IpsecPfsLabel
> = new Map([
  [0, 'none'],
  [1, 'group1'],
  [2, 'group2'],
  [5, 'group5'],
  [14, 'group14'],
  [19, 'group19'],
  [20, 'group20'],
  [21, 'group21']
]);
export const ipsecPfsOptions = transformMapRecordToOption(ipsecPfsRecord);

/** AH 认证算法 */
export const ahAuthAlgorithmRecord: Map<
  TicketManageApi.VPNTemplateManage.AhAuthAlgorithm,
  TicketManageApi.VPNTemplateManage.AhAuthAlgorithmLabel
> = new Map([
  [1, 'MD5'],
  [2, 'SHA1'],
  [3, 'SHA256'],
  [4, 'SM3']
]);
export const ahAuthAlgorithmOptions = transformMapRecordToOption(ahAuthAlgorithmRecord);

/** IPSec 封包协议 */
export const ipsecTransformRecord: Map<
  TicketManageApi.VPNTemplateManage.IpsecTransform,
  TicketManageApi.VPNTemplateManage.IpsecTransformLabel
> = new Map([
  [1, 'AH'],
  [2, 'ESP']
]);
export const ipsecTransformOptions = transformMapRecordToOption(ipsecTransformRecord);

/** DPD 探测启用停用 */
export const dpdEnableRecord: Map<Api.Common.EnableStatus, TicketManageApi.VPNTemplateManage.DpdEnableLabel> = new Map([
  [true, '启用'],
  [false, '停用']
]);
export const dpdEnableOptions = transformMapRecordToOption(dpdEnableRecord);
